<?php include 'header.php'; 
//       include '../logic/funcionesChachis.php';?>
<style>
        
    .contenedorBlog {
        float:left;
        color:black;
        margin-top:10px;
        text-align:center;
        /*margin-bottom:215px;*/
    }
    
    .contenedorNoticiaBlog {
        float:left;
        /*margin:.8%;*/
        width:100%;
        height:auto;
        padding:10px 0 5px 10px;
        margin:0;
        border-bottom:silver solid 1px;
        border-radius:0;
        -webkit-transition-property: background;
        -webkit-transition-duration: .3s;
        -webkit-transition-timing-function: ease;
        -moz-transition-property: background;
        -moz-transition-duration: .3s;
        -moz-transition-timing-function: ease;
    }
    
    .contenedorNoticiaBlog:hover {
        background-color: #eff1ff;
        /*cursor:pointer;*/
        /*border: #5789ad solid 1px;*/
    }
    .imagenBlog {
        float:left;
        width:100%;
        height:auto;
    }
    
    .by {
        text-align:left;
        font-size:13px;
        padding-top:5px;
    }
    .resumen {
        float:left;
        /*margin-top:10px;*/
        padding:10px;
        width:calc(100% - 400px);
        text-align:left;
        font-size:13px;
    }
    
    a.titular {
        float:left;
        margin-top:10px;
        width:200px;
        font-weight:bold;
        border-radius:13px;
        color:black;
        font-size:15px;
        -webkit-transition-property: color;
        -webkit-transition-duration: .3s;
        -webkit-transition-timing-function: ease;
        -moz-transition-property: color;
        -moz-transition-duration: .3s;
        -moz-transition-timing-function: ease;
    }
    
    a.titular:hover {
        color:#5789ae;
        text-decoration:none;
    }
    
    .blog {
        font-weight:bold;
        background-color:#5789ad;
        color:white;
        font-size:20px;
        text-align:center;
        float:left;
        width:100%;
    }
    
    .contenedorImgBlog {
        float:left;
        width:50px;
        height:50px;
        overflow:hidden;
        padding:2px;
        box-shadow: none;
        /*border-radius:5px;*/
/*        background-color:white;
        padding:2px;
        border:silver solid 1px;*/
        /*box-shadow: 2px 2px 10px #888888;*/
    }
    
     .remove {
            -webkit-transition-property: color;
            -webkit-transition-duration: .3s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: color;
            -moz-transition-duration: .3s;
            -moz-transition-timing-function: ease;
        }

        .search {
            -webkit-transition-property: color;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: color;
            -moz-transition-duration: .5s;
            -moz-transition-timing-function: ease;
        }

        .pencil {
            -webkit-transition-property: color;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: color;
            -moz-transition-duration: .5s;
            -moz-transition-timing-function: ease;
        }
        .remove:hover {
            color:red;
        }

        .search:hover {
            color:blue;
        }

        .pencil:hover {
            color:green;
        }

        .opcion {
            float:right;padding:5px 5px 5px 5px;margin:2px;

            -webkit-transition-property: border;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: border;
            -moz-transition-duration: .5s;
            -moz-transition-timing-function: ease;
            /*border:transparent solid 1px;*/
        }

        .opcion:hover {
            cursor:pointer;
            /*border:black solid 1px;*/
        }
        
         div.elemento {
            width:100%;
            cursor:pointer;
            border-style:solid;
            border-color: silver;
            border-width:0px 0 1px 0;
            -webkit-transition-property: background;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: background;
            -moz-transition-duration: 1s;
            -moz-transition-timing-function: ease;
        }
        div.elemento:hover {
            background-color:#eff1ff;
        }
</style>
    <body>
        <?php include '../menus/menuUsuario.php'; ?>
            <?php include 'sidebar.php'; ?>
            <div class="content">
                <div class="header">
                        <h1 class="page-title">Mensajes del buzón de sugerencias</h1>
                    </div>
                <div style="width:100%;min-height:98%;">
                    
                <?php
                if ($asuntos = misMensajes(0)){
                    if(!isset($_GET['pagina'])) {
                        $_GET['pagina'] = 1;
                    }
                    $resPorPagina=10;
                    $resultados = paginar(count($asuntos), $resPorPagina, $_GET['pagina']); //número total de resultados, resultados por página, número de página
       
                    $i = $resultados['i'];
                    while ($i < $resultados['max']) {
                        include 'mensajesEncontrados.php';
                        $i++;
                    }
                }
                ?>
                <div style="width:100%;text-align:center">
                    <?php if (count($asuntos) > $resPorPagina) { ?>
                        <ul class="pagination">
                            <?php if ($_GET['pagina'] == 1) { ?>
                                <li><a href="#">&laquo;</a></li>
                            <?php } else { ?>
                                <li><a href="mensajes.php?pagina=<?php echo $_GET['pagina']-1 ?>">&laquo;</a></li>
                            <?php }
                            for ($in = 0 ; $in < (count($asuntos)/$resPorPagina) ; $in++) { ?>
                                <?php if ($in+1 == $_GET['pagina']) { ?>
                                    <li class="active"><a href="#"><?php echo $in+1 ?></a></li>
                                <?php } else { ?>
                                    <li><a href="mensajes.php?pagina=<?php echo $in+1 ?>"><?php echo $in+1 ?></a></li>
                                <?php } ?>
                            <?php }?>
                            <?php if ($_GET['pagina'] >= (count($asuntos)/$resPorPagina)) { ?>
                                <li><a href="#">&raquo;</a></li>
                            <?php } else { ?>
                                <li><a href="mensajes.php?pagina=<?php echo $_GET['pagina']+1 ?>">&raquo;</a></li>
                            <?php } ?>
                        </ul>
                    <?php } ?>
                </div>
             </div>
            <?php include 'footer.php' ?>
            </div>
    </body>
</html>